<template>
  <section>
    <!-- 面包屑 -->
      <breadcrumbs></breadcrumbs>
    <btns @exec="exec"></btns>
    <div class="data-container scroll-table">
      <div>
        <div class="ind-title lh50 f16">课程列表</div>
      </div>
      <el-table :data="tableData" style="width: 100%" row-key="dictId" border @selection-change="tableSelectionChange">
        <el-table-column type="selection" width="40"> </el-table-column>
        <el-table-column label="课程标题" prop="title" align="center">
        </el-table-column>
        <el-table-column label="评论内容" prop="content" align="center">
        </el-table-column>
        <el-table-column label="评论昵称" prop="nickname" align="center">
        </el-table-column>
        <el-table-column label="评论时间" prop="addtime" align="center">
        </el-table-column>
        <!-- <el-table-column prop="name" label="用户操作" width="300" align="center">
          <template slot-scope="scope">
            <el-button type="text" size="small" @click="goClassDetail(scope.row)">查看</el-button>
            <el-button type="text" size="small" @click="goCommentList(scope.row)">查看评论列表</el-button>
            <el-button type="text" size="small" @click="goOrderList(scope.row,1)">管理课程内容</el-button>
            <el-button @click="goOrderList(scope.row,2)" type="text" size="small">管理课程关联</el-button>
          </template>
        </el-table-column> -->
      </el-table>
    </div>
    <div class="pages">
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5, 10, 15, 20]"
                     :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
      </el-pagination>
    </div>
    <!--新增修改界面-->
    <el-dialog :title="funTit == 'add' ? '新增' : '修改'" :visible.sync="addORUpdateVisible" width="700px" :close-on-click-modal="false" :before-close='clearAdd'>
      <el-form :model="classForm" label-width="120px" :rules="classFormRules" ref="classForm">
        <el-form-item label="课程标题" prop="title">
          <el-input v-model="classForm.title" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="课程类型" prop="courseType">
          <el-radio v-model="classForm.type" label="1">培训</el-radio>
          <el-radio v-model="classForm.type" label="2">研修</el-radio>
        </el-form-item>
        <el-form-item label="课程封面" prop="headImg">
          <el-upload :action="uploadFile" list-type="picture-card" :on-remove="handleRemove" :on-success="handleAvatarSuccess" v-model="classForm.headImg"
                     :limit="1" :file-list="filesEdit">
            <i class="el-icon-plus"></i>
            <div class="el-upload__tip" slot="tip">只能上传1图片</div>
          </el-upload>
        </el-form-item>
        <!-- 添加老师 :loading="loading" :remote-method="remoteMethod" -->
        <el-form-item label="选择老师" :label-width="formLabelWidth" prop="teacherId">
          <el-select v-model="classForm.teacherId" multiple filterable remote reserve-keyword placeholder="请输入关键词">
            <el-option v-for="item in options" :key="item.wxUserId" :label="item.nickname" :value="item.wxUserId"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click.native="clearAdd()">取消</el-button>
        <el-button type="primary" v-if="funTit!='detail'" @click.native="submit('classForm')">提交</el-button>
      </div>
    </el-dialog>
  </section>
</template>

<script>
import btns from "@/components/btns.vue";
import Editor from "@/components/edit";
import breadcrumbs from "@/components/breadcrumbs.vue";
export default {
  components: {
    btns,
    Editor,
    breadcrumbs,
  },
  data() {
    var FengValidate = (rule, value, callback) => {
      // console.log(this.addfile);
      if (this.addfile == "") {
        callback(new Error("请选择封面图片"));
      }
      // if (value == null || value == '') {
      //   this.activeNames = ['2'];
      // }
    };
    return {
      funTit: 'add',
      uploadFile: this.GLOBAL.imgBaseUrl,
      classForm: {},
      classFormRules: {
        title: [
          { required: true, message: "请输入课程标题", trigger: "change" },
        ],
        courseType: [
          { required: true, message: "请选择课程类型", trigger: "blur" },
        ],
        headImg: [
          {
            required: true, message: '请上传课程封面', trigger: 'change'
          }
        ],
      },
      options: [],
      filesEdit: [],
      addORUpdateVisible: false,

      Editlink: "",
      EditAddfile: "",
      createAddfile: "",
      hasFile: false,
      isShowGoodsListEdit: false,
      isShowProductListEdit: false,
      isShowFengEdit: false,
      isShowEditedit: false,
      EditForm: {},
      dialogEditFormVisible: false,
      isShowGoodsList: false,
      isShowProductList: false,
      isShowFeng: false,
      ProductList: [],
      GoodsList: [],
      isShow: false,
      Adaddfile: "",
      searchForm: { name: "" },
      tableData: [],
      currentPage: 1,
      pageSize: 5,
      total: 0,
      dialogCreateFormVisible: false,
      createForm: {},
      formLabelWidth: "120px",
      addfile: "",
      importFileUrl: this.GLOBAL.imgBaseUrl,
      isShowEdit: false,
      bannerList: [
        { id: 1, label: "小程序首页轮播" },
        { id: 2, label: "小程序首页固定" },
        { id: 3, label: "pc端道德与法治" },
        { id: 4, label: "pc端主题教育" },
        { id: 5, label: "pc端成长与信仰" },
      ],
      bannerTypeList: [
        { id: 1, label: "无关联" },
        { id: 2, label: "课程" },
        { id: 3, label: "新闻资讯" },
        { id: 4, label: "学术引领" },
        { id: 5, label: "培训" },
        { id: 5, label: "研修" },
      ],
      rules: {
        // name: [
        //   { required: true, message: '请输入banner名称', trigger: 'blur' },
        //   // { validator: allNumValidate, trigger: 'blur' }
        // ],
        bannerPosition: [
          { required: true, message: "请选择banner位置", trigger: "change" },
          // { validator: allNumValidate, trigger: 'blur' }
        ],
        bannerType: [
          { required: true, message: "请选择banner类型", trigger: "change" },
          // { validator: allNumValidate, trigger: 'blur' }
        ],
        adimg: [
          { required: true, message: "请选择广告位图片", trigger: "change" },
          // { validator: allNumValidate, trigger: 'blur' }
        ],
        fengImg: [
          // { required: true, message: '请选择封面图片', trigger: 'blur' },
          { validator: FengValidate, trigger: "change" },
        ],
        content: [
          { required: true, message: "请选择详情图片", trigger: "change" },
          // { validator: allNumValidate, trigger: 'blur' }
        ],
        productList: [
          { required: true, message: "请选择商家", trigger: "change" },
          // { validator: allNumValidate, trigger: 'blur' }
        ],
        goodsList: [
          { required: true, message: "请选择商品", trigger: "change" },
          // { validator: allNumValidate, trigger: 'blur' }
        ],
      },
    };
  },
  created() {
    this.getList(this.currentPage, this.pageSize);
    this.remoteMethod();
    // 1道德与法治
    //  gradeId年纪       道德与法治-年级 code:ddfz_nj
    // textbookId 教材    pid:道德与法治-年级dictid
    // unitId单元         pid:道德与法治-教材dictid
    //moldId 类型        道德与法治-类型 code:ddfz_lx
    //versionId 版本     道德与法治-版本 code:ddfz_bb

    // 2主题教育        
    //  gradeId年纪     主题教育-年级 code:ztjy_nj
    //moldId 类型       主题教育-类型 code:ztjy_lx

    // 3成长与信仰
    //defId 分类        成长信仰-分类 code:czxy_fl
    this.getDictListByparentCode('czxy_fl');
    // this.getGoodsList();
    // this.getProductList();
  },
  methods: {
    //删除数据
    del() {
      if (this.tableSelection.length < 1) {
        this.$message.error('请选中一行数据');
        return
      }
      this.$confirm("确认要删除这条课程关联, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        let ids = this.tableSelection.map(e => {
          return e.contentId
        })
        this.$api.course
          .delCourseContent({
            contentIds: ids.join(','),
          })
          .then((d) => {
            if (d.code == 200) {
              this.$message({
                type: "success",
                message: "删除成功",
              });
              this.getList(this.id);
            } else {
              this.$message.error(d.msg);
            }
          });
      })
        .catch(() => {
          this.$message.info("已取消启用");
        });
    },
    goCommentList(row) {
      this.$router.push({
        path: `/comment/list`,
        query: { id: row.courseId }
      })
    },
    goOrderList(row, index) {
      // index为1，表示课程内容列表； 为2，表示课程关联列表
      if (index == 1) {
        this.$router.push({
          path: `/class/list/Contentlist`,
          query: { id: row.courseId }
        })
      } else {
        this.$router.push({
          path: `/class/list/Relationlist`,
          query: { id: row.courseId }
        })
      }

    },
    remoteMethod() {
      this.$api.teacher
        .getTeacherList({
          beginTime: '',
          endTime: '',
          keyword: "",
        })
        .then((d) => {
          this.options = d.data;
        })
        .catch((e) => {
          console.log(e);
        });

    },
    getDictListByparentCode(pid) {
      this.loading = true;
      this.$api.dict
        .getDictListByparentCode({
          pid: pid,
        })
        .then((d) => {
          this.loading = false;
          // this.options = d.data;
        })
        .catch((e) => {
          console.log(e);
        });

    },
    clearAdd() {
      if (this.$refs.hasOwnProperty("trainForm")) {
        this.$refs['trainForm'].resetFields();
      }
      this.trainForm = {}
      this.addORUpdateVisible = false;
      this.filesEdit = [];
      this.dynamicValidateForm.domains = [];
      this.$refs.child.clearText();
      this.tableSelection = []
    },
    add() {
      this.addORUpdateVisible = true;
      this.funTit = 'add'
    },
    update() {
      if (this.tableSelection.length != 1) {
        this.$message.error('请选中一行数据');
        return
      }
      this.trainForm.type = this.tableSelection[0].type + '';
      this.trainForm.address = this.tableSelection[0].address;
      this.trainForm.content = this.tableSelection[0].content;
      this.trainForm.school = this.tableSelection[0].school;
      this.trainForm.title = this.tableSelection[0].title;
      this.trainForm.teacherId = [this.tableSelection[0].teachId]
      // this.tableSelection[0].teachId + ''.split(",").forEach(e => {
      //   if (e != "") {
      //     console.log('========', e)
      //     this.trainForm.teacherId.push(e)
      //   }
      // })
      console.log(this.tableSelection[0].begintime, [new Date(this.tableSelection[0].begintime), new Date(this.tableSelection[0].endtime)]);
      this.trainForm.time = [new Date(this.tableSelection[0].begintime), new Date(this.tableSelection[0].endtime)]
      this.trainForm.signTime = [new Date(this.tableSelection[0].signBegintime), new Date(this.tableSelection[0].signEndtime)]
      this.tableSelection[0].labels.split(',').forEach(e => {
        if (e != "")
          this.dynamicValidateForm.domains.push({
            value: e,
            key: Date.now()
          })
      })
      let file = this.tableSelection[0].headImg.split(",");
      file.forEach((item, index) => {
        if (item != "") {
          this.filesEdit.push({
            url: item,
            index: index
          })
        }
      });
      this.addORUpdateVisible = true;
      this.funTit = 'update'
    },
    submit(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          let label = this.dynamicValidateForm.domains.map(e => {
            return e.value
          }) || ''
          let params = {
            address: this.trainForm.address,
            endTime: this.formatTime(this.trainForm.time[1]),
            beginTime: this.formatTime(this.trainForm.time[0]),
            content: this.trainForm.content,
            headImg: this.trainForm.headImg,
            school: this.trainForm.school,
            signBeginTime: this.formatTime(this.trainForm.signTime[0]),
            signEndTime: this.formatTime(this.trainForm.signTime[1]),
            title: this.trainForm.title,
            type: this.trainForm.type,
            labels: label.join(',') || '',
            teacherId: this.trainForm.teacherId,
          }
          // console.log('----------------', params);
          if (this.funTit == 'add') {
            this.$api.train
              .addTrain(params)
              .then((d) => {
                if (d.code == 200) {
                  this.clearAdd();
                  this.search();
                  this.$message.success('操作成功！');
                } else {
                  this.$message.error(d.msg);
                }
              })
              .catch((e) => {
                console.log(e);
              });
          } else {
            this.$api.train
              .editTrain(params)
              .then((d) => {
                if (d.code == 200) {
                  this.clearAdd();
                  this.$message.success('操作成功！');
                } else {
                  this.$message.error(d.msg);
                }
              })
              .catch((e) => {
                console.log(e);
              });
          }
        }
      })
    },
    //启用
    enable() {
      if (this.tableSelection.length != 1) {
        this.$message.error("请选中一行数据");
        return;
      }
      this.$confirm("确认要启用这条banner, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$api.banner
            .updateState({
              bannerIds: this.tableSelection[0].bannerId,
              status: 1, //状态 0禁用 1启用
            })
            .then((d) => {
              if (d.code == 200) {
                this.$message({
                  type: "success",
                  message: "启用成功",
                });
                this.getList(this.currentPage, this.pageSize);
              } else {
                this.$message.error(d.msg);
              }
            });
        })
        .catch(() => {
          this.$message.info("已取消启用");
        });
    },
    //禁用
    disable() {
      if (this.tableSelection.length != 1) {
        this.$message.error("请选中一行数据");
        return;
      }
      this.$confirm("确认要禁用这条banner, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$api.banner
            .updateState({
              bannerIds: this.tableSelection[0].bannerId,
              status: 0, //状态 0禁用 1启用
            })
            .then((d) => {
              if (d.code == 200) {
                this.$message({
                  type: "success",
                  message: "禁用成功",
                });
                this.getList(this.currentPage, this.pageSize);
              } else {
                this.$message.error(d.msg);
              }
            });
        })
        .catch(() => {
          this.$message.info("已取消禁用");
        });
    },
    editBanner(formName) {
      this.$api.banner
        .updateBanner({
          bannerId: this.EditForm.bannerId,
          bannerPosition: this.EditForm.bannerPosition,
          bannerType: this.EditForm.bannerType,
          link: this.EditForm.link,
          bannerSort: this.EditForm.bannerSort,
          bannerUrl: this.EditAddfile,
          linkType: 0
        })
        .then((d) => {
          if (d.code == 200) {
            this.$message.success("编辑banner信息成功");
            this.getList(this.currentPage, this.pageSize);
            //  this.$refs.child.clearText();
            this.dialogEditFormVisible = false;
          } else {
            this.$message.error(d.msg);
          }
        });

    },

    geEdittUrl(item) {
      // this.EditAddfile = item.data.url;
      this.EditAddfile = item;
      // console.log(this.Adaddfile);
      this.$message({
        type: "success",
        message: "图片上传成功",
      });
    },
    getProductList() {
      this.$api.store
        .getStoreList({
          pageno: 1,
          pagesize: 200,
        })
        .then((d) => {
          if (d.code == 1) {
            this.ProductList = d.data;
          }
        });
    },
    getGoodsList() {
      this.$api.goods.getStoreGoodsList().then((d) => {
        if (d.code == 1) {
          d.data.forEach((item) => {
            if (item.enable == 1) {
              this.GoodsList.push(item);
            }
          });

          // this.GoodsList = d.data;
        }
      });
    },
    getList(curr, page) {
      this.$api.course
        .getCourseList({
          current: curr,
          size: page,
        })
        .then((d) => {
          if (d.code == 200) {
            this.tableData = d.data;
            this.total = d.totalCount;
            console.log(d.data);
          }
        });
    },
    getUrlAd(item) {
      this.createForm.addfile = item;
      // console.log(item);
      this.isShow = true;
      // console.log(this.Adaddfile);
      this.$message({
        type: "success",
        message: "图片上传成功",
      });
      // console.log(this.editimg);
    },
    showEdit() {
      if (this.createForm.bannerType == 1) {
        this.isShowEdit = false;
        this.isShowGoodsList = true;
        this.isShowProductList = false;
        this.isShowFeng = true;
      } else if (this.createForm.bannerType == 2) {
        this.isShowGoodsList = false;
        this.isShowEdit = false;
        this.isShowFeng = true;
        this.isShowProductList = true;
      } else if (this.createForm.bannerType == 3) {
        this.isShowGoodsList = false;
        this.isShowEdit = true;
        this.isShowFeng = true;
        this.isShowProductList = false;
      }
    },
    showEditType() {
      // console.log(this.EditForm.type);
      if (this.EditForm.type == 1) {
        this.isShowEditedit = false;
        this.isShowGoodsListEdit = true;
        this.isShowProductListEdit = false;
        this.isShowFengEdit = true;
      } else if (this.EditForm.type == 2) {
        this.isShowGoodsListEdit = false;
        this.isShowEditedit = false;
        this.isShowFengEdit = true;
        this.isShowProductListEdit = true;
      } else if (this.EditForm.type == 3) {
        this.isShowGoodsListEdit = false;
        this.isShowEditedit = true;
        this.isShowFengEdit = false;
        this.isShowProductListEdit = false;
      }
    },

    addBanner(formName) {
      // this.$refs[formName].validate((valid) => {
      //   if (valid) {
      //     let parmers = {};
      // if (this.createForm.type == 3) {

      //   parmers.bannerType = this.createForm.bannerType;
      //   parmers.bannerPosition = this.createForm.bannerPosition;

      //   parmers.link = this.createForm.link;
      //   parmers.linkType = 1;
      // } else if (this.createForm.type == 1) {
      //   parmers.bannerType = this.createForm.bannerType;
      //   parmers.bannerPosition = this.createForm.bannerPosition;
      //   parmers.bannerUrl = this.createForm.bannerUrl;
      //   parmers.link = this.createForm.link;
      //   parmers.linkType = 1;
      // } else if (this.createForm.type == 2) {
      //   // console.log(this.createForm.productList);
      //   parmers.objectId = this.createForm.productList;
      //   parmers.type = 2;
      //   (parmers.picUrl = this.createAddfile),
      //     (parmers.tokenUser = sessionStorage.getItem("token").token);
      // }
      // parmers.site = parseInt(this.createForm.region);

      //  parmers.
      this.$api.banner.addBanner({
        bannerType: this.createForm.bannerType,
        bannerPosition: this.createForm.bannerPosition,
        bannerSort: this.createForm.bannerSort,
        bannerUrl: this.createForm.addfile,
        link: this.createForm.link,
        linkType: 1
      }).then((d) => {
        if (d.code == 200) {
          this.dialogCreateFormVisible = false;
          this.$message.success("banner添加成功");
          this.$refs.child.clearText();
          this.hasFile = false;
          this.getList(this.currentPage, this.pageSize);
        } else {
          this.$message.error(d.msg);
        }
      });


    },
    clearText() {
      this.content = "";
    },
    beforeAvatarUpload(file) {
      console.log(file, 231232)
      const isLt2M = file.size / 1024 / 1024 < 10;
      if (!isLt2M) {
        this.$message.error('上传头像图片大小不能超过 10MB!');
      }
      return isLt2M;
    },
    getUrl(item) {
      this.hasFile = true;
      // console.log(this.addfile);
      // this.addfile = item.data.url;
      this.createForm.addfile = item;
      this.createAddfile = item;
      // console.log(item);
      // this.isShow = true;
      this.$message({
        type: "success",
        message: "图片上传成功",
      });
      // console.log(this.editimg);
    },
    //打开新增模态框
    add() {



      this.createForm = {
        "bannerType": '',
        "bannerPosition": '',
        "bannerUrl": '',
        "link": '',
        "linkType": '',

      }

      this.isShowGoodsList = false;
      this.isShowEdit = false;
      this.isShowFeng = false;
      this.isShowProductList = false;


      this.dialogCreateFormVisible = true;
    },
    //打开编辑模态框
    update() {
      if (this.tableSelection.length != 1) {
        this.$message.error('请选中一行数据');
        return
      }
      // this.isShowGoodsList = false;
      //   this.isShowEdit = true;
      //   this.isShowFeng = true;
      //   this.isShowProductList = false;
      //   // this.dialogCreateFormVisible = true;
      // // console.log(1231231, this.tableSelection[0]);
      // this.EditForm = this.tableSelection[0];
      // if (this.tableSelection[0].type == 1) {
      //   this.isShowEditedit = false;
      //   this.isShowFengEdit = true;
      //   (this.isShowProductListEdit = false), (this.isShowGoodsListEdit = true);
      //   let goods = "";
      //   this.GoodsList.forEach((item) => {
      //     if (item.goodsId == this.tableSelection[0].objectId) {
      //       goods = item.title;
      //     }
      //   });
      //   this.EditForm = {
      //     region: this.tableSelection[0].region,
      //     site: this.tableSelection[0].site,
      //     sort: this.tableSelection[0].sort,
      //     title: this.tableSelection[0].title,
      //     type: this.tableSelection[0].sType,
      //     goodsList: goods,
      //     bannerId: this.tableSelection[0].bannerId,
      //     stype: 1,
      //     objectId: this.tableSelection[0].objectId,
      //   };
      //   this.EditAddfile = this.tableSelection[0].picUrl;
      // } else if (this.tableSelection[0].type == 2) {
      //   this.isShowEditedit = false;
      //   this.isShowFengEdit = true;
      //   (this.isShowProductListEdit = true), (this.isShowGoodsListEdit = false);
      //   let product = "";
      //   // console.log(123131312, this.ProductList);
      //   this.ProductList.forEach((item) => {
      //     if (item.storeId == this.tableSelection[0].objectId) {
      //       product = item.storeName;
      //     }
      //   });
      //   this.EditForm = {
      //     region: this.tableSelection[0].region,
      //     site: this.tableSelection[0].site,
      //     sort: this.tableSelection[0].sort,
      //     title: this.tableSelection[0].title,
      //     type: this.tableSelection[0].sType,
      //     productList: product,
      //     bannerId: this.tableSelection[0].bannerId,
      //     stype: 2,
      //     objectId: this.tableSelection[0].objectId,
      //   };
      //   this.EditAddfile = this.tableSelection[0].picUrl;
      // } else if (this.tableSelection[0].type == 3) {
      this.isShowEditedit = true;
      this.isShowFengEdit = true;
      this.isShowProductListEdit = false;
      this.isShowGoodsListEdit = false;
      // this.$refs.child.clearText();
      this.EditForm = {
        bannerPosition: this.tableSelection[0].bannerPosition,
        bannerType: this.tableSelection[0].bannerType,
        link: this.tableSelection[0].link,
        bannerId: this.tableSelection[0].bannerId,
        linkType: this.tableSelection[0].linkType,
        addfile: this.tableSelection[0].bannerUrl,
        bannerSort: this.tableSelection[0].bannerSort,

      };
      this.EditAddfile = this.tableSelection[0].bannerUrl;
      this.Editlink = this.tableSelection[0].link,
        console.log("this.Editlink============================" + this.Editlink)


      // console.log(12312312312, this.EditForm);
      this.dialogEditFormVisible = true;
    },
    //删除数据
    del() {
      if (this.tableSelection.length != 1) {
        this.$message.error('请选中一行数据');
        return
      }
      this.$confirm("确认要删除这条banner, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$api.banner
            .updateState({
              bannerIds: this.tableSelection[0].bannerId,
              status: -1, //状态 0禁用 1启用
            })
            .then((d) => {
              if (d.code == 200) {
                this.$message({
                  type: "success",
                  message: "删除成功",
                });
                this.getList(this.currentPage, this.pageSize);
              } else {
                this.$message.error(d.msg);
              }
            });
        })
        .catch(() => {
          this.$message.info("已取消删除");
        });
    },
    search() { },
    handleReset() {
      this.$refs.searchForm.resetFields();
      this.search();
    },
    exec(fun) {
      if (this[fun]) {
        this.funTit = fun;
        this[fun]();
      } else {
        this.$message.error("方法未定义");
      }
    },
    tableSelectionChange(val) {
      this.tableSelection = val;
    },
    handleSizeChange(val) {
      this.pageSize = val;
      this.getList(this.currentPage, val);
      // eslint-disable-next-line no-console
      // console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      this.currentPage = val;
      this.getList(val, this.pageSize);
      // eslint-disable-next-line no-console
      // console.log(`当前页: ${val}`);
    },
  },
};
</script>

<style lang="scss" scoped>
.dialog-footer {
  margin-top: 50px;
}
.img-feng {
  width: 120px;
  height: 120px;
}
.goods {
  width: 500px;
}
.icon {
  display: flex;
  justify-content: space-between;
  i {
    font-size: 25px;
  }
}
</style>
